using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DealerWorld.Forms
{
    public partial class vehicle : Form
    {
        private Vehicle veh;

        public vehicle(Vehicle v)
        {
            InitializeComponent();

            veh = v;

            vin.Text = veh.vin;
            license.Text = veh.licensePlate;
            type.Text = veh.type;
            //year.Value = DateTime.
            mileage.Text = veh.mileage.ToString();
            id.Text = veh.typeId;
            model.Text = veh.model;
            make.Text = veh.make;
            color.Text = veh.color;
            //number.Text = veh.customer.mainPhone;
            //name.Text = veh.customer.name;
            //address.Text = veh.customer.address;
        }

        private void btn_cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btn_save_Click(object sender, EventArgs e)
        {
            veh.vin = vin.Text;
            veh.licensePlate = license.Text;
            veh.type = type.Text;
            //veh.mileage = (int)mileage.Text;
            veh.typeId = id.Text;
            veh.model = model.Text;
            veh.make = make.Text;
            veh.color = color.Text;
            veh.customer.mainPhone = number.Text;
            veh.customer.name = name.Text;
            veh.customer.address = address.Text;

            this.Close();
        }
    }
}